package com.itheima.mytest;

import com.itheima.domain.system.User;
import com.itheima.service.system.impl.UserServiceImpl;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

/**
 * @Author:Mr.yuan
 * @Description:
 * @Date: Created in 22:50 2020/11/29
 * @ModifiedBy:
 */
public class MyTest_Yzy {
    private UserServiceImpl userService = null;

    @Before
    public void init() {
        userService = new UserServiceImpl();
    }

    @After
    public void destroy() {
        userService = null;
    }



    @Test
    public void userTest_login() {
        User user = new User();
        user.setUsername("jack");
        user.setPassword("1234");
        User all = userService.login(user);
        System.out.println(all.getEmail());
    }
    @Test
    public void userTest_findByID() {
        User byId = userService.findById("ceshoshuj");
        System.out.println(byId.getEmail());
    }
    @Test
    public void userTest_update() {
        User byId = userService.findById("ceshoshuj");
        byId.setPassword("123456");
        userService.updatePWD(byId);
    }
}
